﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VideoServer.Model
{
    public class Packet : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private string _iD, _armStatus, _netStatus;
        private byte _temperature;
        private UInt16 _remainMem;

        public string ID
        {
            get
            {
                return _iD;
            }

            set
            {
                _iD = value;
                OnPropertyChanged("ID");
            }
        }

        public string ArmStatus
        {
            get
            {
                return _armStatus;
            }

            set
            {
                _armStatus = value;
                OnPropertyChanged("ArmStatus");
            }
        }

        public string NetStatus
        {
            get
            {
                return _netStatus;
            }

            set
            {
                _netStatus = value;
                OnPropertyChanged("NetStatus");
            }
        }

        public byte Temperature
        {
            get
            {
                return _temperature;
            }

            set
            {
                _temperature = value;
                OnPropertyChanged("Temperature");
            }
        }

        public ushort RemainMem
        {
            get
            {
                return _remainMem;
            }

            set
            {
                _remainMem = value;
                OnPropertyChanged("RemainMem");
            }
        }

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this,new PropertyChangedEventArgs(propertyName));
        }
    }
}
